
import network
import time



# 开启之后 功耗变高!!
## 0.01 ~ 0.06 mA -> 0.06~ 0.14 mA
# 所以 默认关闭

###### ap
# ap config: ('192.168.4.1', '255.255.255.0', '192.168.4.1', '0.0.0.0')
# ,hidden=True
def start(isON=False):
    if not isON:
        return
    ap = network.WLAN(network.AP_IF)
    ap.config(essid='esp32_sun',password='@88889999',authmode=network.AUTH_WPA_WPA2_PSK,pm=network.WLAN.PM_POWERSAVE)
    ap.config(max_clients=2)
    ap.active(True)
    time.sleep(2)
    print('ap config:', ap.ifconfig())



